package com.zust.java.bean;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Repository;

@Repository
public class Order implements Comparable<Order>{

	private int id;
	private int orderNo;
	private Date creatTime;
	private Date deadline;
	
	private JobShop jobShop;
	private Account account;
	private List<OrderDetail> list = new ArrayList<OrderDetail>();
	
	public Order() {
		
	}

	@Override
	public String toString() {
		return "Order [id=" + id + ", orderNo=" + orderNo + ", creatTime=" + creatTime + ", deadline=" + deadline
				+ ", jobShop=" + jobShop + ", account=" + account + ", list=" + list + "]";
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(int orderNo) {
		this.orderNo = orderNo;
	}

	public Date getCreatTime() {
		return creatTime;
	}

	public void setCreatTime(Date creatTime) {
		this.creatTime = creatTime;
	}

	public Date getDeadline() {
		return deadline;
	}

	public void setDeadline(Date deadline) {
		this.deadline = deadline;
	}

	public JobShop getJobShop() {
		return jobShop;
	}

	public void setJobShop(JobShop jobShop) {
		this.jobShop = jobShop;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public List<OrderDetail> getList() {
		return list;
	}

	public void setList(List<OrderDetail> list) {
		this.list = list;
	}

	public int compareTo(Order o) {
		return creatTime.compareTo(o.getCreatTime());
	}

}
